package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SysCompanyContactConfigController.SMSControllerApi;
import com.nineclock.system.service.SMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/sms")
@RestController
public class SMSControllrt implements SMSControllerApi {

    @Autowired
    private SMSService smsService;

    @GetMapping("/code")
    @Override
    public Result sendCode(String mobile, String type) {
        smsService.sendCode(mobile, type);

        return Result.success();
    }

    /*
    * 验证码校验
    * */

    @GetMapping("/verify")
    @Override
    public Result verify(String checkcode, String mobile, String type) {
        Boolean success = smsService.verifyCode(checkcode, mobile, type);
        return Result.success(success);
    }


}
